package alejandro.castro.extras;

public class Point {

	double x, y;
	
	public Point(double x, double y) {
		this.x = x;
		this.y = y;				
	}

	public double getX() {
		return x;
	}

	public void setX(double x) {
		this.x = x;
	}

	public double getY() {
		return y;
	}

	public void setY(double y) {
		this.y = y;
	}
	
	public Point toVersor(){		
		double hypotenuse = Math.sqrt(x * x + y * y);
		this.x = x / hypotenuse;
		this.y = y / hypotenuse;
		return this;
	}

	public void addX(double xAdd) {
		x += xAdd;		
	}
	public void addY(double yAdd) {
		y += yAdd;		
	}
	
}
